from django.urls import path
from . import views

urlpatterns = [
    # 消息管理
    path('', views.message_list, name='message-list'),
    path('<int:pk>/', views.message_detail, name='message-detail'),
    path('<int:pk>/publish/', views.publish_message, name='publish-message'),

    # Dashboard统计接口
    path('latest/', views.latest_messages, name='latest-messages'),  # 最新通知

    # 新增: 公告通知和园区咨询接口
    path('announcements/', views.announcement_list, name='announcement-list'),
    path('announcements/<int:pk>/', views.announcement_detail, name='announcement-detail'),
    path('consultations/', views.consultation_list, name='consultation-list'),
    path('consultations/<int:pk>/', views.consultation_detail, name='consultation-detail'),
    path('user-messages/', views.user_messages, name='user-messages'),
    
    # 通用消息详情接口 - 可以获取任何类型的消息
    path('messages/<int:pk>/', views.message_detail, name='message-detail-generic'),

    # 问题反馈接口
    path('feedbacks/', views.feedback_list, name='feedback-list'),
    path('feedbacks/create/', views.create_feedback, name='create-feedback'),
    path('feedbacks/<int:pk>/', views.feedback_detail, name='feedback-detail'),
    path('feedbacks/<int:pk>/delete/', views.delete_feedback, name='delete-feedback'),
] 